package com.ciaojian.client.util;

import cn.hutool.core.date.DateUtil;

import java.util.Calendar;
import java.util.Date;
import java.util.Scanner;

public class Constants {
    public static Integer DAY = Calendar.getInstance().get(Calendar.DATE);
    public static Integer DAY2 = null;
    public static Integer PLATFORM_ENV_DEV = 1;


    public static void main(String[] args) {
        // 月份
        Integer months;
        // 天数
        Integer days;
        // 种子大小(单位 GB)
        float Si;
        // 种子做种人数
        float Ni;
        final int N0 = 7;
        final float T0 = 4;

        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入月份");
        months = Integer.valueOf(scanner.nextLine());
        System.out.println("请输入天数");
        days = Integer.valueOf(scanner.nextLine());
        System.out.println("请输入种子大小");
        Si = Float.parseFloat(scanner.nextLine());
        System.out.println("请输入做种人数");
        Ni = Integer.parseInt(scanner.nextLine());

        Date curDate = new Date();
        Date beginDate = DateUtil.offsetDay(DateUtil.offsetMonth(curDate, -months), -days);
        // 周数
        float Ti = DateUtil.betweenWeek(beginDate, curDate, false);

        double result = (1 - Math.pow(10,- Ti / T0)) * Si * (1 + Math.sqrt(2) * Math.pow(10, -(Ni - 1) / (N0 - 1)));
        System.out.println(result);

    }

}
